package ch03.cglib;

import net.sf.cglib.proxy.Enhancer;

public class DaiLi {

    public static HuoCheZhan daiShou(){
        //创建enhancer对象
        Enhancer enhancer=new Enhancer();
        //获取目标对象父类
        enhancer.setSuperclass(HuoCheZhan.class);
        //获取代理实现类
        enhancer.setCallback(new TrainStationMethodInterceptor());
        //获取代理对象
        HuoCheZhan huoCheZhan =(HuoCheZhan)enhancer.create();
        return huoCheZhan;
    }
}
